package Tree;

import java.util.ArrayList;
import java.util.List;

public class leet_144 {
}

class Solution_144 {
    List<Integer> result = new ArrayList<>();
    public List<Integer> preorderTraversal(TreeNode root) {
        inOrder(root);
        return result;
    }

    public void inOrder(TreeNode root){
        if(root==null){
            return;
        }

        result.add(root.val);
        inOrder(root.left);
        inOrder(root.right);
    }
}